Skip to content

Conversation

@forkfury
Copy link

@forkfury forkfury commented Nov 13, 2025

Add constant value check at the start of AssertIsCrumb to avoid unnecessary constraint generation for compile-time constants.

Use separate variable x instead of overwriting input parameter for better code clarity.
Add mathematical comment explaining the polynomial constraint derivation, matching the SCS implementation style.


Note

Add constant-input check and clearer/optimized constraints for AssertIsCrumb in R1CS/SCS, plus new snippet and stats entries.

  • Frontend API (AssertIsCrumb):
    • R1CS (frontend/cs/r1cs/api_assertions.go):
      • Add constant-input check with early return or panic; improve comments.
      • Refactor to use intermediate x and enforce x(x+2)==0 via two MulAcc then AssertIsEqual.
    • SCS (frontend/cs/scs/api_assertions.go):
      • Add constant-input check with detailed panic message.
      • Keep single-constraint form: compute x and enforce 2x + x^2 == 0 via a single PLONK constraint; add explanatory comments.
  • Stats/Tooling:
    • Register new snippet api/AssertIsCrumb (internal/stats/snippet.go).
    • Update internal/stats/latest_stats.csv with api/AssertIsCrumb metrics for multiple curves/backends (Groth16, PLONK).

Written by Cursor Bugbot for commit 03dee3a. This will update automatically on new commits. Configure here.

forkfury and others added 5 commits November 13, 2025 20:12
Add constant value check at the start of AssertIsCrumb to avoid unnecessary
constraint generation for compile-time constants. Use separate variable x
instead of overwriting input parameter for better code clarity. Add mathematical
comment explaining the polynomial constraint derivation, matching the SCS
implementation style.
@ivokub ivokub changed the base branch from master to typo/fixes-v15 November 25, 2025 14:22
@ivokub ivokub merged commit 87f846d into Consensys:typo/fixes-v15 Nov 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants